package a.j;

import a.b.b;
import a.b.d;
import a.b.k;

import java.awt.*;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;

public class nc
  implements MouseWheelListener
{
  private boolean a = false;
  private boolean b = true;
  private double c = 4.9E-324D;
  private double d = 1.7976931348623157E+308D;
  private boolean e = false;
  private boolean f = false;
  private Color g;
  protected MouseWheelEvent h;
  private b_ i;
  private boolean j = false;
  private d k;
  public static int l;
  
  public nc()
  {
    a(new Color(60, 60, 60));
  }
  
  public void a(pg parampg)
  {
    parampg.B().addMouseWheelListener(this);
  }
  
  public void b(pg parampg)
  {
    parampg.B().removeMouseWheelListener(this);
  }
  
  public void a(boolean paramBoolean)
  {
    this.f = paramBoolean;
  }
  
  public boolean a()
  {
    return this.f;
  }
  
  public void mouseWheelMoved(MouseWheelEvent paramMouseWheelEvent)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    this.h = paramMouseWheelEvent;
    Object localObject = paramMouseWheelEvent.getSource();
    label326:
    label456:
    if ((bool2) || ((localObject instanceof og)))
    {
      og localog = (og)localObject;
      pg localpg = (pg)localog.getParent();
      double d1 = localog.c(paramMouseWheelEvent.getX());
      double d2 = localog.d(paramMouseWheelEvent.getY());
      double d3 = localog.i();
      int m = 0;
      if (!bool2) {
        if (paramMouseWheelEvent.getScrollType() == 1)
        {
          m = paramMouseWheelEvent.getWheelRotation();
          if (bool2) {
            break label126;
          }
          if (!bool1) {
            break label124;
          }
        }
      }
      if (!bool2) {
        if (paramMouseWheelEvent.getScrollType() == 0) {
          m = paramMouseWheelEvent.getUnitsToScroll();
        }
      }
      label124:
      if (m != 0)
      {
        label126:
        Point2D localPoint2D = localog.h();
        double d4 = a(d3, m);
        d4 = Math.min(d4, c());
        d4 = Math.max(d4, d());
        double d6;
        if (!bool2) {
          if (a())
          {
            Rectangle localRectangle = localpg.a().d();
            Dimension localDimension = localpg.K();
            d6 = localRectangle.width * d4;
            double d7 = localRectangle.height * d4;
            double d8 = Math.max(10, localDimension.width - 10);
            double d9 = Math.max(10, localDimension.height - 10);
            if (bool2) {
              break label326;
            }
            if (m > 0)
            {
              if (bool2) {
                break label326;
              }
              if (d8 > d6)
              {
                if (bool2) {
                  break label326;
                }
                if (d9 > d7)
                {
                  d4 = d3;
                  double d10 = d8 / localRectangle.width;
                  double d11 = d9 / localRectangle.height;
                  d4 = Math.min(d10, d11);
                }
              }
            }
          }
        }
        if (!bool2)
        {
          if (d4 != d3) {
            localpg.b(d4);
          }
        }
        else
        {
          if (!bool2)
          {
            if (a(paramMouseWheelEvent)) {
              localpg.a(localPoint2D.getX(), localPoint2D.getY());
            }
          }
          else
          {
            if (bool2) {
              break label456;
            }
            if (!bool1) {
              break label436;
            }
          }
          double d5 = localog.c(paramMouseWheelEvent.getX());
          d6 = localog.d(paramMouseWheelEvent.getY());
          d1 = localPoint2D.getX() + d1 - d5;
          d2 = localPoint2D.getY() + d2 - d6;
          localpg.a(d1, d2);
          c(localpg);
          localpg.b();
          if ((bool2) || (f())) {
            a(m, d3, d4);
          }
        }
      }
    }
    label436:
  }
  
  protected double a(double paramDouble, int paramInt)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (paramInt == 0) {
        return paramDouble;
      }
    }
    if (!bool) {
      if (this.a) {
        paramInt *= -1;
      }
    }
    return paramInt > 0 ? paramDouble / 1.25D : paramDouble * 1.25D;
  }
  
  protected void c(pg parampg)
  {
    Rectangle localRectangle = parampg.a().d();
    parampg.a(localRectangle.x - 20, localRectangle.y - 20, localRectangle.width + 40, localRectangle.height + 40);
  }
  
  protected boolean a(MouseWheelEvent paramMouseWheelEvent)
  {
    boolean bool = ld.E;
    if ((bool) || (b())) {
      if (bool) {}
    }
    return (paramMouseWheelEvent.getModifiers() & 0x2) == 0;
  }
  
  public boolean b()
  {
    return this.b;
  }
  
  public void b(boolean paramBoolean)
  {
    this.b = paramBoolean;
  }
  
  public double c()
  {
    return this.d;
  }
  
  public void a(double paramDouble)
  {
    this.d = paramDouble;
  }
  
  public double d()
  {
    return this.c;
  }
  
  public void b(double paramDouble)
  {
    this.c = paramDouble;
  }
  
  public boolean e()
  {
    return this.a;
  }
  
  public void c(boolean paramBoolean)
  {
    this.a = paramBoolean;
  }
  
  void a(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    boolean bool = ld.E;
    if (((bool) || (this.h != null)) && ((bool) || ((this.h.getSource() instanceof og))))
    {
      pg localpg = (pg)((og)this.h.getSource()).getParent();
      if (!bool) {
        if (this.i == null)
        {
          this.i = new b_(localpg, true);
          this.k = new d(false);
          this.k.a(new b()
          {
            public void a(k paramAnonymousk)
            {
              boolean bool = ld.E;
              if (!bool) {
                if (paramAnonymousk.a() == 3) {
                  nc.this.j = true;
                }
              }
              if (((bool) || (ld.D)) && ((bool) || (paramAnonymousk.a() == 4))) {
                nc.this.j = false;
              }
            }
          });
          this.k.a(localpg);
        }
      }
      if ((bool) || (!this.j))
      {
        if (!bool) {}
        this.i.e = (paramDouble1 > 0.0D);
        this.i.a = this.h.getX();
        this.i.b = this.h.getY();
        this.k.a(this.i);
      }
    }
  }
  
  public void d(boolean paramBoolean)
  {
    this.e = paramBoolean;
  }
  
  public boolean f()
  {
    return this.e;
  }
  
  protected void a(Graphics2D paramGraphics2D, int paramInt1, int paramInt2, int paramInt3, int paramInt4, double paramDouble, MouseWheelEvent paramMouseWheelEvent)
  {
    int m = (int)(255.0D * (1.0D - 0.8D * paramDouble));
    Color localColor = new Color(g().getRed(), g().getGreen(), g().getBlue(), m);
    paramGraphics2D.setStroke(c.f);
    paramGraphics2D.setColor(localColor);
    int n = 15;
    GeneralPath localGeneralPath;
    AffineTransform localAffineTransform;
    if (this.h.getWheelRotation() < 0)
    {
      localGeneralPath = new GeneralPath(0, 5);
      localGeneralPath.moveTo(paramInt1, paramInt2 + n);
      localGeneralPath.curveTo(paramInt1, paramInt2, paramInt1, paramInt2, paramInt1 + n, paramInt2);
      paramGraphics2D.draw(localGeneralPath);
      localAffineTransform = AffineTransform.getScaleInstance(-1.0D, 1.0D);
      localAffineTransform.translate(-2 * paramInt1 - paramInt3, 1.0D);
      paramGraphics2D.draw(localAffineTransform.createTransformedShape(localGeneralPath));
      localAffineTransform = AffineTransform.getScaleInstance(1.0D, -1.0D);
      localAffineTransform.translate(1.0D, -2 * paramInt2 - paramInt4);
      paramGraphics2D.draw(localAffineTransform.createTransformedShape(localGeneralPath));
      localAffineTransform = AffineTransform.getScaleInstance(-1.0D, -1.0D);
      localAffineTransform.translate(-2 * paramInt1 - paramInt3, -2 * paramInt2 - paramInt4);
      paramGraphics2D.draw(localAffineTransform.createTransformedShape(localGeneralPath));
      if (!ld.E) {
        if (!ld.D) {
          return;
        }
      }
    }
    else
    {
      localGeneralPath = new GeneralPath(0, 5);
      localGeneralPath.moveTo(paramInt1, paramInt2 + n);
      localGeneralPath.curveTo(paramInt1 + n, paramInt2 + n, paramInt1 + n, paramInt2 + n, paramInt1 + n, paramInt2);
      paramGraphics2D.draw(localGeneralPath);
      localAffineTransform = AffineTransform.getScaleInstance(-1.0D, 1.0D);
      localAffineTransform.translate(-2 * paramInt1 - paramInt3, 1.0D);
      paramGraphics2D.draw(localAffineTransform.createTransformedShape(localGeneralPath));
      localAffineTransform = AffineTransform.getScaleInstance(1.0D, -1.0D);
      localAffineTransform.translate(1.0D, -2 * paramInt2 - paramInt4);
      paramGraphics2D.draw(localAffineTransform.createTransformedShape(localGeneralPath));
      localAffineTransform = AffineTransform.getScaleInstance(-1.0D, -1.0D);
      localAffineTransform.translate(-2 * paramInt1 - paramInt3, -2 * paramInt2 - paramInt4);
    }
    paramGraphics2D.draw(localAffineTransform.createTransformedShape(localGeneralPath));
  }
  
  public void a(Color paramColor)
  {
    this.g = paramColor;
  }
  
  public Color g()
  {
    return this.g;
  }
  
  class b_
    implements a.b.c
  {
    double a;
    double b;
    pg c;
    AffineTransform d;
    boolean e;
    double f;
    a_ g = new a_();
    qb h;
    
    b_(pg parampg, boolean paramBoolean)
    {
      this.c = parampg;
      this.e = paramBoolean;
    }
    
    public void a(double paramDouble)
    {
      if (!ld.E) {
        if (paramDouble > 0.0D) {
          paramDouble = 1.0D - 1.0D / ((1.0D + paramDouble) * (1.0D + paramDouble) * (1.0D + paramDouble) * (1.0D + paramDouble));
        }
      }
      double d1 = this.e ? 50.0D + 50.0D * (1.0D - paramDouble) : 50.0D + 50.0D * paramDouble;
      this.g.setFrame(this.a - 0.5D * d1, this.b - 0.5D * d1, d1, d1);
      this.g.b = paramDouble;
    }
    
    public void b()
    {
      this.c.b(this.h);
      nc.this.i = null;
    }
    
    public void a()
    {
      this.h = new ff(this.c, this.g);
      this.c.a(this.h);
    }
    
    public long c()
    {
      return 500L;
    }
    
    class a_
      extends Rectangle
      implements qb
    {
      int a;
      public double b;
      
      a_() {}
      
      public void paint(Graphics2D paramGraphics2D)
      {
        nc.this.a(paramGraphics2D, this.x, this.y, this.width, this.height, this.b, nc.this.h);
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.nc

 * JD-Core Version:    0.7.0.1

 */